Set an empty NSImage if there is none, covers the cases where applications
authorRichard Hult <richard@imendio.com>
Mon, 17 Jul 2006 21:21:25 +0000 (21:21 +0000)
committerRichard Hult <rhult@src.gnome.org>
Mon, 17 Jul 2006 21:21:25 +0000 (21:21 +0000)
2006-07-17  Richard Hult  <richard@imendio.com>

* gtk/gtkdnd-quartz.c: (gtk_drag_begin_internal): Set an empty
NSImage if there is none, covers the cases where applications try
to set a pixmap which is not supported by the quartz backend.

ChangeLog
ChangeLog.pre-2-10
gtk/gtkdnd-quartz.c

index 77fef5ffecc54a6532d2e667be5208e8b74c1481..7b6691afdf4f9cc208b768a2ae0225bce7b5479d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-07-17  Richard Hult  <richard@imendio.com>
+
+       * gtk/gtkdnd-quartz.c: (gtk_drag_begin_internal): Set an empty
+       NSImage if there is none, covers the cases where applications try
+       to set a pixmap which is not supported by the quartz backend.
+
 2006-07-17  Richard Hult  <richard@imendio.com>
 
        * gdk/quartz/gdkevents-quartz.c: (create_key_event):
index 77fef5ffecc54a6532d2e667be5208e8b74c1481..7b6691afdf4f9cc208b768a2ae0225bce7b5479d 100644 (file)
@@ -1,3 +1,9 @@
+2006-07-17  Richard Hult  <richard@imendio.com>
+
+       * gtk/gtkdnd-quartz.c: (gtk_drag_begin_internal): Set an empty
+       NSImage if there is none, covers the cases where applications try
+       to set a pixmap which is not supported by the quartz backend.
+
 2006-07-17  Richard Hult  <richard@imendio.com>
 
        * gdk/quartz/gdkevents-quartz.c: (create_key_event):
index c868674603c53ae4957b4366283865d5642e19df..ec44ef64e17de771d8fa00f6c0926fe6c7f6fb4c 100644 (file)
@@ -1040,11 +1040,28 @@ gtk_drag_begin_internal (GtkWidget         *widget,
        switch (site->icon_type)
          {
          case GTK_IMAGE_PIXMAP:
-           gtk_drag_set_icon_pixmap (context,
-                                     site->colormap,
-                                     site->icon_data.pixmap.pixmap,
-                                     site->icon_mask,
-                                     -2, -2);
+           /* This is not supported, so just set a small transparent pixbuf
+            * since we need to have something.
+            */
+           if (0)
+             gtk_drag_set_icon_pixmap (context,
+                                       site->colormap,
+                                       site->icon_data.pixmap.pixmap,
+                                       site->icon_mask,
+                                       -2, -2);
+           else
+             {
+               GdkPixbuf *pixbuf;
+
+               pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 1, 1);
+               gdk_pixbuf_fill (pixbuf, 0xffffff);
+           
+               gtk_drag_set_icon_pixbuf (context,
+                                         pixbuf,
+                                         0, 0);
+
+               g_object_unref (pixbuf);
+             }
            break;
          case GTK_IMAGE_PIXBUF:
            gtk_drag_set_icon_pixbuf (context,